/*
 *  Line.h
 *  SoundController0002
 *
 *  Created by jiro on 10/06/28.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include "NullableObject.h"
#include <string>
#include <sstream>

namespace sc 
{

	class Line : public NullableObject
	{
	public:
	
		enum Type
		{
			Type_Straight,

			Type_Parabola,

			Type_ConvexParabola,
			
			Type_ConcateParabola,
			
			Type_Null,
		};

	private:
	
		Type type;
	
		double startX;
		
		double startY;
		
		double endX;
		
		double endY;

	public:
	
		Line( Type type, double startX, double startY, double endX, double endY );

		virtual ~Line();
		
		bool operator == ( const Line& rhs ) const;
		
		bool operator != ( const Line& rhs ) const;

		bool operator < ( const Line& rhs ) const;

		bool operator > ( const Line& rhs ) const;

		bool operator <= ( const Line& rhs ) const;
		
		bool operator >= ( const Line& rhs ) const;

		virtual double GetY( double paramX ) const = 0;

		Type GetType() const;

		double GetStartX() const;

		double GetStartY() const;

		double GetEndX() const;

		double GetEndY() const;

		std::string ToString( Type type ) const;

		virtual std::string ToString() const;

	};

}